import React, { Component } from 'react'
// 定义路由规则
import { Routes, Route, Link, NavLink, Navigate } from 'react-router-dom'//v5
import Home from '../views/home/home'
import Index from '../views/children/index'

/*
[  @router  ]
*/
var routers = (
    <>
        <Routes data-router>
            <Route path="/" element={<Navigate to="/home/id_1" replace={true} key="navi" />}></Route>
            <Route path="/home" element={<Navigate to="/home/id_1" replace={true} key="navi" />}></Route>
            {/*  */}
            <Route path="/home" element={< Home key="home" />}>
                <Route path=":id" element={< Index key="index" />}></Route>
            </Route>
        </Routes >
    </>
)
/*
[  router  ]
*/
export default () => {
    return routers
}